home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4274 < prev    next >
Encoding:
Text File  |  1996-08-06  |  903 b   |  29 lines

  1. Newsgroups: comp.lang.c++
  2. Path: netcom.com!gibson
  3. From: gibson@netcom.com (Bob Gibson)
  4. Subject: Re: Help!! I'm a stuck newbie - input problem
  5. Message-ID: <gibsonDLy1zo.JA0@netcom.com>
  6. Organization: A number of persons or groups united for some purpose
  7. X-Newsreader: TIN [version 1.2 PL1]
  8. References: <4eh3vl$g8i@atlas.uniserve.com>
  9. Date: Mon, 29 Jan 1996 13:11:48 GMT
  10. Sender: gibson@netcom21.netcom.com
  11.  
  12. Chris (nowher@anyplace.com) wrote:
  13. ...
  14. : I need to input a string with a max length of 15 chars.
  15.  
  16.   One of the member functions of cin is getline, of where there
  17. are multiple signitures provided.  One of which is:
  18.  
  19.   istream& getline( char * ptr, int len, char delim = '\n' );
  20.  
  21.   This means that if you provide a length as the second parameter,
  22. getline will make sure that no more than len charas are stored.
  23.  
  24. Bob
  25. -- 
  26. O.J. Verdict - The best innocence money can buy
  27.  
  28. Bob Gibson -- gibson@netcom.com
  29.